<?php
session_start();
ob_start();
if (!isset($_SESSION['loggedin'])) {

    header('Location: login.php');
}
?>
<?php include 'index.php';
include '../connection.php';
if ( isset( $_GET['lang'] ) )
	$lang = $_GET['lang'];
else
	$lang = 'en';
	
include 'lang/lang_'.$lang.'.php';


?>



<head>
<link rel="stylesheet" href="style_<?= $lang ?>.css" media="screen" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Added Items</title>
</head>

<div id="body-wrapper">

    <div id="main-content">
	<div class="content-box">
		
		  <div class="content-box-header">

                <h3><?= addedItems ?></h3>

                <div class="clear"></div>

            </div> 

       

	 

           
                    
              

                    <table>
                        <thead>
                            <tr>
                              
                                <th><?= product_name ?></th>
                                <th><?= added_name ?></th>
								<th><?= username ?></th>
								<th><?= added_date ?></th>
                            </tr>
                        </thead>
						
					<tfoot>
						<tr>
						                   
                                       
                                     <td style="color:red"; >Total products</td>
										<?php 
                                      $sql = "SELECT COUNT(id) FROM products";
									 $result = mysql_query($sql);
									$row = mysql_fetch_array($result)
									
									?>
									
									

							  <td style = "color:blue"><?= $row['0']?></td>
						</tr>
					  </tfoot>
                       

                        <tbody>
                          
                         
                         
                          
                              <?php 
							



							  $sql = "SELECT a.fullname , a.username , p.name_en , p.added_date
									  FROM admins a , products p
									  WHERE p.added_by = a.id";

							 
							  $result = mysql_query($sql);
							  while ($row = mysql_fetch_array($result)) {
							  
								?>
							  <tr>
							  <td><?= $row['name_en']?></td>
							  <td><?= $row['fullname']?></td>
							  <td><?= $row['username']?></td>
							  <td><?= $row['added_date']?></td>
							  </tr>
							  <?php
					       	}//end while 
									
									?>
									
									
								
									    
									
									  

                              
						
                        </tbody>
						

                    </table>
					
					
						
						
                </div> 
				
			

            </div> 

        </div> 





    </div> <!-- End #main-content -->

</div>